home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1998 January / PC Answers Issue 49 Cover CD January 1998.iso / Apps / Director / DATA.Z / Scriptable Authoring.dir / Scripts_11_Start-End-Idle Movie Handlers.ls < prev    next >
Encoding:
Text File  |  1997-05-10  |  4.0 KB  |  114 lines

  1. global gScriptAuthoringWindow, gNavScriptAuthorWindow, gCurrentCastLib, gPuppetList, gMaskName, gCostumeName, gFloatName, gBandName, gFloatReplaceMember, gBandReplaceMember, gPathDelimiter, gCostumeSpriteList, gParadePartsList
  2.  
  3. on openThisWindow
  4.   set gScriptAuthoringWindow to the activeWindow
  5.   if the activeWindow = the stage then
  6.     nothing()
  7.   else
  8.     set the windowType of gScriptAuthoringWindow to 4
  9.     set the title of gScriptAuthoringWindow to "Scriptable Authoring"
  10.   end if
  11. end
  12.  
  13. on closeWindow
  14.   sound stop 1
  15.   sound stop 2
  16.   forget(gNavScriptAuthorWindow)
  17.   forget(gScriptAuthoringWindow)
  18.   if count(the windowList) < 1 then
  19.     clearGlobals()
  20.   end if
  21. end
  22.  
  23. on prepareMovie
  24.   openThisWindow()
  25.   if objectp(gNavScriptAuthorWindow) then
  26.     forget(gNavScriptAuthorWindow)
  27.   end if
  28.   InitGlobals()
  29. end
  30.  
  31. on InitGlobals
  32.   set gPuppetList to [:]
  33.   addProp(gPuppetList, #maskHilite, 18)
  34.   addProp(gPuppetList, #costumeHilite, 25)
  35.   addProp(gPuppetList, #captainCostume, 29)
  36.   addProp(gPuppetList, #captainMask, 30)
  37.   addProp(gPuppetList, #setOneCast, 5)
  38.   addProp(gPuppetList, #setTwoCast, 9)
  39.   addProp(gPuppetList, #floatSprite, 15)
  40.   addProp(gPuppetList, #bandSprite, 31)
  41.   addProp(gPuppetList, #aquaFloat, 8)
  42.   addProp(gPuppetList, #cosmosFloat, 10)
  43.   addProp(gPuppetList, #tropicanaFloat, 12)
  44.   addProp(gPuppetList, #royHarperBand, 24)
  45.   addProp(gPuppetList, #hanksVoodooBand, 26)
  46.   addProp(gPuppetList, #nightbloomersBand, 28)
  47.   addProp(gPuppetList, #captainButton, 17)
  48.   addProp(gPuppetList, #floatButton, 19)
  49.   set gParadePartsList to [:]
  50.   addProp(gParadePartsList, #floatChannel, 4)
  51.   addProp(gParadePartsList, #headChannel, 6)
  52.   addProp(gParadePartsList, #costumeChannel, 7)
  53.   addProp(gParadePartsList, #maskChannel, 8)
  54.   set gCurrentCastLib to "set1"
  55.   set gMaskName to "None"
  56.   set gCostumeName to "None"
  57.   set gCostumeSpriteList to [#mask: 0, #costume: 0]
  58.   set gFloatName to #aquaFloat
  59.   set gBandName to #royHarperBand
  60.   set gFloatReplaceMember to member 2 of castLib "Floats & Band"
  61.   set gBandReplaceMember to member 71 of castLib "Floats & Band"
  62.   if the machineType = 256 then
  63.     set gPathDelimiter to "/"
  64.   else
  65.     set gPathDelimiter to ":"
  66.   end if
  67.   DisplayCurrentCastLib()
  68.   InitNavWindow()
  69. end
  70.  
  71. on InitNavWindow
  72.   set gNavScriptAuthorWindow to window "ScriptAuthor-Navigate.dir"
  73.   set the title of gNavScriptAuthorWindow to "Navigate.dir"
  74.   if the machineType = 256 then
  75.     set the windowType of gNavScriptAuthorWindow to 4
  76.   else
  77.     set the windowType of gNavScriptAuthorWindow to 5
  78.   end if
  79.   set the fileName of gNavScriptAuthorWindow to the pathName & "ScriptAuthor-Nav.dir"
  80.   set windowHeight to 82
  81.   set windowWidth to 240
  82.   set verticalOffset to 265
  83.   set horizontalOffset to 40
  84.   if gScriptAuthoringWindow = the stage then
  85.     set verticalOrigin to the stageTop
  86.     set horizontalOrigin to the stageLeft
  87.   else
  88.     set verticalOrigin to getAt(the rect of gScriptAuthoringWindow, 2)
  89.     set horizontalOrigin to getAt(the rect of gScriptAuthoringWindow, 1)
  90.   end if
  91.   set verticalOrigin to verticalOrigin + verticalOffset
  92.   set horizontalOrigin to horizontalOrigin + horizontalOffset
  93.   set the rect of gNavScriptAuthorWindow to rect(horizontalOrigin, verticalOrigin, horizontalOrigin + windowWidth, verticalOrigin + windowHeight)
  94.   open(gNavScriptAuthorWindow)
  95. end
  96.  
  97. on stopMovie
  98.   if objectp(gNavScriptAuthorWindow) then
  99.     forget(gNavScriptAuthorWindow)
  100.   end if
  101.   set the fileName of castLib "Costume set" to the pathName & "set1"
  102.   importFileInto(gFloatReplaceMember, the pathName & "ScriptAuthor-Floats" & gPathDelimiter & string("aquaFloat.PCT"))
  103.   importFileInto(gBandReplaceMember, the pathName & "ScriptAuthor-Bands" & gPathDelimiter & string("royHarperBand.PCT"))
  104.   ClearTextFields()
  105. end
  106.  
  107. on ClearTextFields
  108.   set the text of member "gMaskName Field" to "default"
  109.   set the text of member "gCostumeName Field" to "default"
  110.   set the text of member "gCurrentCastLib Field" to "default"
  111.   set the text of member "gFloatName Field" to "default"
  112.   set the text of member "gBandName Field" to "default"
  113. end
  114.